/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package bpmn.impl;

import bpmn.ArtifactInput;
import bpmn.BpmnPackage;
import bpmn.InputSet;
import bpmn.Property;

import java.util.Collection;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.util.EObjectResolvingEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Input Set</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link bpmn.impl.InputSetImpl#getArtifactInputs <em>Artifact Inputs</em>}</li>
 *   <li>{@link bpmn.impl.InputSetImpl#getPropertyInputs <em>Property Inputs</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class InputSetImpl extends SupportingElementImpl implements InputSet {
	/**
	 * The cached value of the '{@link #getArtifactInputs() <em>Artifact Inputs</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getArtifactInputs()
	 * @generated
	 * @ordered
	 */
	protected EList<ArtifactInput> artifactInputs;

	/**
	 * The cached value of the '{@link #getPropertyInputs() <em>Property Inputs</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPropertyInputs()
	 * @generated
	 * @ordered
	 */
	protected EList<Property> propertyInputs;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected InputSetImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return BpmnPackage.Literals.INPUT_SET;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<ArtifactInput> getArtifactInputs() {
		if (artifactInputs == null) {
			artifactInputs = new EObjectResolvingEList<ArtifactInput>(ArtifactInput.class, this, BpmnPackage.INPUT_SET__ARTIFACT_INPUTS);
		}
		return artifactInputs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Property> getPropertyInputs() {
		if (propertyInputs == null) {
			propertyInputs = new EObjectResolvingEList<Property>(Property.class, this, BpmnPackage.INPUT_SET__PROPERTY_INPUTS);
		}
		return propertyInputs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case BpmnPackage.INPUT_SET__ARTIFACT_INPUTS:
				return getArtifactInputs();
			case BpmnPackage.INPUT_SET__PROPERTY_INPUTS:
				return getPropertyInputs();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case BpmnPackage.INPUT_SET__ARTIFACT_INPUTS:
				getArtifactInputs().clear();
				getArtifactInputs().addAll((Collection<? extends ArtifactInput>)newValue);
				return;
			case BpmnPackage.INPUT_SET__PROPERTY_INPUTS:
				getPropertyInputs().clear();
				getPropertyInputs().addAll((Collection<? extends Property>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case BpmnPackage.INPUT_SET__ARTIFACT_INPUTS:
				getArtifactInputs().clear();
				return;
			case BpmnPackage.INPUT_SET__PROPERTY_INPUTS:
				getPropertyInputs().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case BpmnPackage.INPUT_SET__ARTIFACT_INPUTS:
				return artifactInputs != null && !artifactInputs.isEmpty();
			case BpmnPackage.INPUT_SET__PROPERTY_INPUTS:
				return propertyInputs != null && !propertyInputs.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //InputSetImpl
